<?php

class DefaultController extends Controller {

    public $content = array();

    //public $content;
    public function actionIndex() {
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/theme.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/base.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/css.css");

        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/account_settings.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/search.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/jquery-ui.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/chat.css");


        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery-1.js");
         Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/search/index.js");
        
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/lib.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/onload.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/community.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery-1.9.1.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/lib.json2.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery-ui-1.9.2.custom.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery-mods.js");

        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/peoplemedia.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/peoplemedia_rtn_slide.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/logger.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/peoplemedia.theming.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/stacktrace-min-0.3.js");

        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery.ba-bbq.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/index.js");


        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery.cookie.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery.base64.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/moment.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/logger.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/pmchat-1.0.js?d=20131009.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/pmchat.ui-1.0.js?d=20131009.js");

        if(isset($_GET['keywords'])){
            $criteria = new CDbCriteria();
            $criteria->addSearchCondition('username', $_GET['keywords']);
            $models = User::model()->findAll($criteria);
        }
        
        $this->render('index');
    }

    public function actionSearch() {
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/theme.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/base.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/css.css");

        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/account_settings.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/search.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/jquery-ui.css");
        Yii::app()->clientScript->registerCssFile(WWW_URL . "css/css1/chat.css");


        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery-1.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/lib.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/onload.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/community.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery-1.9.1.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/lib.json2.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery-ui-1.9.2.custom.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery-mods.js");

        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/peoplemedia.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/peoplemedia_rtn_slide.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/logger.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/peoplemedia.theming.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/stacktrace-min-0.3.js");

        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery.ba-bbq.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/index.js");


        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery.cookie.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/jquery.base64.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/moment.min.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/logger.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/pmchat-1.0.js?d=20131009.js");
        Yii::app()->clientScript->registerScriptFile(WWW_URL . "js/pmchat.ui-1.0.js?d=20131009.js");


       /* $this->content['search'] = 1;
        $this->render('search', array('search' => 1));
    }

}
